package edu.cmu.cs211.chess.board;

import java.util.HashMap;

public class RepetitionTable<M extends Move<M>, B extends Board<M, B>> {
	private HashMap<B, Integer> rep = new HashMap<B, Integer>();
	
	public int lookup(B b){
		if(rep.containsKey(b))
			return rep.get(b);
		return 0;
	}
	
	public void delta(B b, int d){
		int count = 0;
		if(rep.containsKey(b)){
			count = rep.get(b);
		}
		rep.put(b.copy(), d+count);
	}
}
